home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group01b.txt / 000146_icon-group-sender_Tue Sep 25 16:37:27 2001.msg < prev    next >
Internet Message Format  |  2002-01-03  |  3KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f8PNbOM19787
  4.     for icon-group-addresses; Tue, 25 Sep 2001 16:37:24 -0700 (MST)
  5. Message-Id: <200109252337.f8PNbOM19787@baskerville.CS.Arizona.EDU>
  6. Date: Tue, 25 Sep 2001 14:01:03 -0700
  7. From: Steve Wampler <swampler@noao.edu>
  8. X-Accept-Language: en
  9. To: Bruce Gordon Rennie <brennie@dcsi.net.au>
  10. CC: icon-group@cs.arizona.edu
  11. Subject: Re: Line limit for ICON on input
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13. Status: RO
  14. Content-Length: 2061
  15.  
  16. Bruce Gordon Rennie wrote:
  17. > To all,
  18. > I am reading a text file that is very large (over 100 Mbytes) and am using the
  19. > following simple program to read and then write the file.
  20. > procedure main()
  21. >         local ifile, cnttab, line, keyword, linesp, keyw, outp
  22. >         write("Translation")
  23. >         (ifile := open("f:\\A\\ForthNG.txt","r")) & write("Have opened file")
  24. >         linesp := 0
  25. >         cnttab := table(0)
  26. >         outp := open("f:\\a\\forthSumNG.txt","w")
  27. >         while line := read(ifile) do {
  28. >                 line ? (if ( ="Date:"   ) then write(outp,line))
  29. >                 (((linesp +:= 1 ) % 1000) = 0) & write(".",linesp)
  30. >                 if (linesp > 204900) then write(line)
  31. >         }
  32. >         write(".",linesp)
  33. > end
  34. > However, it is stopping at line 204931. The purpose is to remove a set of line,
  35. > of which one is given as an example.  But it is not getting past the above line.
  36. > My estimate is that there is over a million lines in this file. Can anyone shed
  37. > any light on this.
  38. > I am using ICON for Windows Version 9.3.1 May 4 1998. Any help appreciated.
  39.  
  40. Are you sure this isn't a windows problem?  I just ran the following variant
  41. of your program on Linux on a 1GB input file (8,388,609 lines) with no problems:
  42.  
  43.     procedure main(args)
  44.         local ifile, cnttab, line, keyword, linesp, keyw, outp
  45.  
  46.         write("Translation")
  47.  
  48.         inFile := args[1]
  49.         outFile := args[2]
  50.  
  51.         (ifile := open(inFile,"r")) & write("Have opened file")
  52.  
  53.         linesp := 0
  54.         cnttab := table(0)
  55.         outp := open(outFile,"w")
  56.  
  57.         while line := read(ifile) do {
  58.             # line ? (if ( ="Date:"   ) then write(outp,line))
  59.             (((linesp +:= 1 ) % 1000) = 0) & write(".",linesp)
  60.             # (linesp > 204900) then write(line)
  61.             }
  62.         write(".",linesp)
  63.  
  64.     end
  65.  
  66. Hmmm, I wonder how many *bytes* you are into the file when it hangs?  I bet
  67. it's close to some magic power of two...
  68.  
  69. --
  70. Steve Wampler-  SOLIS Project, National Solar Observatory
  71. swampler@noao.edu
  72.